#ifndef NNE_DEVICE_VECTOR_PATH_V2_H_
#define NNE_DEVICE_VECTOR_PATH_V2_H_

#include "type.h"
#include "util.h"
#include "mem/dram.h"
#include "mem/sram.h"
#include <memory>

class VectorPath_v2{
public:
    VectorPath_v2(std::shared_ptr<MemInterface> In, std::shared_ptr<MemInterface> Out);
    bool vector_start;
    u32 vector_type;
    u32 ifm_start_addr;
    u32 ifm_width;
    u32 ifm_height;
    u32 ifm_size;
    u32 ofm_width;
    u32 ofm_height;
    u32 ofm_start_h;
    u32 ofm_start_l;
    u32 ofm_addr_w_offset;
    u32 scale_shift;
    u32 scale_num;
    u32 padding_word;
    u32 padding_size;
    u32 pooling_stride;
    u32 reduce_mode;
    u32 ifm_rd_step_config;
    bool irq_status_reg;
    bool irq_mask_reg;
    void Run();
    ~VectorPath_v2();
private:
    s8 *ofmBuffer;
    //u32 ifm_w_step;
    u32 sram_addr_step;
    void element_wise(s8* ifm1, s8* ifm2);
    void pooling(u64 ofm_addr, s8* ifm);
    void reduce_sum(s8* ifm);
    void reduce_mean(s8* ifm);
    void arg_max(s8 *ifm);
    void max(s8 *ifm);
    s8 sat_val(s64 result);
    std::shared_ptr<MemInterface> InMemPtr;
    std::shared_ptr<MemInterface> OutMemPtr;
};

#endif
